package demo00;
class Laptop {
    public void run() {
        System.out.println("笔记本运行");
    }

    public void shutDown() {
        System.out.println("笔记本关机");
    }

    public void useUSB(USB usb) {
        usb.open();
        if (usb instanceof Mouse) {
            Mouse mouse = (Mouse) usb;
            mouse.click();
        } else if (usb instanceof Keyboard) {
            Keyboard keyboard = (Keyboard) usb;
            keyboard.knock();
        }
        usb.close();
    }
}
